package com.ihr360.payroll.service.payroll.mock.core;

import com.ihr360.job.core.JobParameters;
import com.ihr360.job.core.entity.JobExecution;
import com.ihr360.job.core.entity.JobInstance;
import com.ihr360.job.core.entity.StepExecution;
import com.ihr360.job.core.entity.StepExecutionLog;
import com.ihr360.job.core.logger.CalcLog;
import com.ihr360.job.core.repository.JobExecutionAlreadyRunningException;
import com.ihr360.job.core.repository.JobInstanceAlreadyCompleteException;
import com.ihr360.job.core.repository.JobRepository;
import com.ihr360.job.core.repository.PageData;
import com.ihr360.job.core.scope.context.SimpleStepContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.batch.operations.JobRestartException;
import java.util.Collection;
import java.util.List;

public class JobRepositoryMock implements JobRepository {
    @Override
    public boolean isJobInstanceExists(String jobName, JobParameters jobParameters) {
        return false;
    }

    @Override
    public JobInstance createJobInstance(String jobName, JobParameters jobParameters) {
        return null;
    }

    @Override
    public JobExecution createJobExecution(JobInstance jobInstance, JobParameters jobParameters, String jobConfigurationLocation, int stepCount) {
        return null;
    }

    @Override
    public JobExecution getJobExecution(Long executionId) {
        return null;
    }

    @Override
    public JobExecution createJobExecution(String jobName, JobParameters jobParameters, int stepCount) throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException {
        return null;
    }

    @Override
    public void update(JobExecution jobExecution) {
    }

    @Override
    public void add(StepExecution stepExecution) {
    }

    @Override
    public void addAll(Collection<StepExecution> stepExecutions) {

    }

    @Override
    public void update(StepExecution stepExecution) {

    }

    @Override
    public void updateExecutionContext(StepExecution stepExecution) {

    }

    @Override
    public void updateExecutionContext(JobExecution jobExecution) {

    }

    @Override
    public PageData<JobExecution> getFailedJobExecution(int page, int size) {
        return null;
    }

    @Override
    public PageData<JobExecution> getJobExecution(int page, int size) {
        return null;
    }

    @Override
    public PageData<JobExecution> getUnExceptedJobExecution(int page, int size) {
        return null;
    }

    @Override
    public PageData<JobExecution> getLongTimeJobExecution(int page, int size, int minutes) {
        return null;
    }

    @Override
    public StepExecution getLastStepExecution(JobInstance jobInstance, String stepName) {
        return null;
    }

    @Override
    public List<StepExecution> getStepExecutions(JobExecution jobExecution) {
        return null;
    }

    @Override
    public int getStepExecutionCount(JobInstance jobInstance, String stepName) {
        return 0;
    }

    @Override
    public JobExecution getLastJobExecution(String jobName, JobParameters jobParameters) {
        return null;
    }

    @Override
    public PageData<StepExecutionLog> loadLogs(List<Long> executionId, int pageSize, long lastLogId) {
        return null;
    }

    @Override
    public Long getErrorLogCount(List<Long> executionId) {
        return 0L;
    }

    @Override
    public Long getWarningLogCount(List<Long> executionId) {
        return 0L;
    }

    @Override
    public PageData<StepExecutionLog> loadFirstPageLogNoTrace(List<Long> executionId, int pageSize, long lastLogId) {
        return null;
    }

    @Override
    public PageData<StepExecutionLog> loadFirstPageLogOnlyError(List<Long> executionId, int pageSize, long lastLogId) {
        return null;
    }

    @Override
    public PageData<StepExecutionLog> loadLogsNoTrace(List<Long> executionId, int pageSize, long lastLogId) {
        return null;
    }

    @Override
    public PageData<StepExecutionLog> loadLogsOnlyError(List<Long> executionId, int pageSize, long lastLogId) {
        return null;
    }

    final Logger logger = LoggerFactory.getLogger(getClass().getName());

    @Override
    public void trace(SimpleStepContext simpleStepContext, String title, String content) {
        logger.info(title + content);
    }

    @Override
    public void info(SimpleStepContext simpleStepContext, String title, String content) {
        logger.info(title + content);
    }

    @Override
    public void warning(SimpleStepContext simpleStepContext, String title, String content) {
        logger.info(title + content);
    }

    @Override
    public void error(SimpleStepContext simpleStepContext, String title, String content) {
        logger.info(title + content);
    }

    @Override
    public void trace(SimpleStepContext simpleStepContext, String titleKey, String title, String contentKey, String content) {
        logger.info(title + content);
    }

    @Override
    public void info(SimpleStepContext simpleStepContext, String titleKey, String title, String contentKey, String content) {
        logger.info(title, content);
    }

    @Override
    public void warning(SimpleStepContext simpleStepContext, String titleKey, String title, String contentKey, String content) {
        logger.info(title, content);
    }

    @Override
    public void error(SimpleStepContext simpleStepContext, String titleKey, String title, String contentKey, String content) {
        logger.info(title, content);
    }

    @Override
    public void logInBatch(SimpleStepContext simpleStepContext, List<CalcLog> logs) {

    }

    @Override
    public PageData<StepExecutionLog> loadFirstPageLog(List<Long> executionId, int pageSize, long lastLogId) {
        return null;
    }

    @Override
    public int abandonLongTimeJobExecution(int interval) {
        return 0;
    }
}